package com.ap.core.business.message.validation.handler.impl;

import com.ap.core.business.message.domain.translators.BindingMetaData;
import com.ap.core.business.message.validation.handler.AbstractValidationHandler;
import com.ap.core.business.message.validation.info.impl.RTPOriginalInfoImpl;
import com.ap.core.common.types.ValidationType;
import com.ap.core.message.managepayment.info.RetrieveRTPMessageInfo;
import com.ap.core.validation.message.info.MessageValidationInfo;
import com.ap.core.validation.message.info.RTPOriginalInfo;

/**
 * User: Ranjit.Singh
 * Implementation class for {@link com.ap.core.business.message.validation.handler.ValidationHandler} for SubmitRTPType message
 */
public class RetrieveRTPValidationHandler extends AbstractValidationHandler<RetrieveRTPMessageInfo, RTPOriginalInfo> {

    @Override
    protected MessageValidationInfo<RetrieveRTPMessageInfo, RTPOriginalInfo> getMessageValidationInfo(final RetrieveRTPMessageInfo request, final BindingMetaData metaData) {
        return new MessageValidationInfo<RetrieveRTPMessageInfo, RTPOriginalInfo>() {
            @Override
            public RetrieveRTPMessageInfo getBoundObject() {
                return request;
            }

            @Override
            public RTPOriginalInfo getOriginalInfo() {
                return new RTPOriginalInfoImpl(metaData.getOriginalReadOnlyOrderPayment());
            }
        };
    }

}
